/*
ID:fuxiang2
PROG: namenum
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <cmath>

#define REP(i, n) for (int i=0;i<int(n);++i)
#define FOR(i, a, b) for (int i=int(a);i<int(b);++i)
#define DWN(i, b, a) for (int i=int(b-1);i>=int(a);--i)
#define REP_1(i, n) for (int i=1;i<=int(n);++i)
#define FOR_1(i, a, b) for (int i=int(a);i<=int(b);++i)
#define DWN_1(i, b, a) for (int i=int(b);i>=int(a);--i)



using namespace std;


ofstream fout ("namenum.out");
ifstream fin ("namenum.in");
set<string> st;
vector<string  > vs;

const char key[][3] = {
	{ 0, 0, 0 }, { 0, 0, 0 },
	{ 'A', 'B', 'C' }, { 'D', 'E', 'F' }, { 'G', 'H', 'I' }, { 'J', 'K', 'L' },
	{ 'M', 'N', 'O' }, { 'P', 'R', 'S' }, { 'T', 'U', 'V' }, { 'W', 'X', 'Y' }
};
void dfs(int deep ,int maxdeep,string str, bool * flag )
{
	if(deep  == maxdeep){
		if(st.find(str) != st.end())
		{
			fout<<str<<endl;
			*flag = true;
		}
		return ;
	}

	for(int i = 0 ; i < 3; i ++){
		str[deep] = (vs[deep][i]);
		dfs(deep+1,maxdeep,str,flag);
		
	}

}
int main() 
{
	ifstream in("dict.txt");
	string str;
	while(in >> str )
		st.insert(str);
	
	in.close();
	
	string num;
	fin>>num;
	

	REP(i,num.size()){
		int t = num[i] - '0' ;
		string mstr;
		mstr.push_back(key[t][0]); mstr.push_back(key[t][1]); mstr.push_back(key[t][2]);

		vs.push_back(mstr);

	}
	bool flag = false;
	
	string  ss(num.size(),'-1');
	dfs(0,num.size(),ss,&flag);
	if(!flag)
	fout << "NONE" << endl;


	return 0;
}